package com.jeehentor.utils;

import com.jeehentor.common.api.vo.LoginUser;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @Description : Security工具类
 * @Author : wzd
 * @Date : 2024/4/12 12:52
 * @Version : 1.0
 **/
public class SecurityUtil {

    /**
     * 获取当前用户
     * @return
     */
    public static LoginUser getCurrentUser(){
        return  (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }

}
